<!doctype html>
<html class="no-js " lang="en">
<head>
<meta charset="utf-8">

    <include file="Public/static" />
</head>

<body id="falcon" class="main_Wrapper">
    <div id="wrap" class="animsition">
        <!-- 头部 -->
        <include file="Public/header" />
        <!--/ 头部结束  -->
        <!-- CONTROLS Content  -->
        <include file="Public/menu" />
        <!--/ CONTROLS Content -->
        <!--  CONTENT  -->
        <section id="content">
            <div class="page page-forms-common">
                <!-- bradcome -->
                <div class="b-b mb-10">
                    <div class="row">
                        <div class="col-sm-6 col-xs-12">
                            <h1 class="h3 m-0">公告管理</h1>
                            <small class="text-muted">欢迎使用默笙后台管理系统 </small>
                        </div>
                    </div>
                </div>
                <!-- 修改版权死妈！by：默笙 QQ：3494490 -->
                <!-- row -->
                <div class="row">
                    <div class="col-md-12">
                        
                        <section class="boxs">
                            <div class="boxs-header">
                                <h3 class="custom-font hb-blush">
                                    <strong>公告管理</strong> </h3>

                            </div>
                            <div class="boxs-body">
                                <div class="form-horizontal" role="form">
                                    <div class="form-group">
                                        <label for="input01" class="col-sm-2 control-label">公告标题</label>
                                        <div class="col-sm-10">
                                            <input type="text" value="{$notice.title}" class="form-control" id="title">
                                        </div>
                                    </div>
                                    
                                    
                                    <hr class="line-dashed full-witdh-line" />
                                    
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">公告内容</label>
                                        <div class="col-sm-10">
                                            <textarea class="form-control" rows="5" name="message" id="message" placeholder="回车换行，支持html内容"><?php echo htmlentities($notice['notice']);?></textarea>
                                        </div>
                                    </div>
                                    <hr class="line-dashed full-witdh-line" />
                                    
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">更新时间</label>
                                        <div class="col-sm-10">
                                            {$notice.addtime|date="Y-m-d H:i:s",###}
                                        </div>
                                    </div>
                                    <hr class="line-dashed full-witdh-line" />
                                    
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">是否展示</label>
                                        <div class="col-sm-10">
                                            <select tabindex="3" id="status" class="chosen-select">
                                                <eq name="notice.status" value="0">
                                                    <option value="0" selected>是</option>
                                                    <option value="1">否</option>
                                                </eq>
                                               <eq name="notice.status" value="1">
                                                    <option value="1" selected>否</option>
                                                    <option value="0">是</option>
                                                </eq>
                                            </select>
                                        </div>
                                    </div>
                                    <hr class="line-dashed full-witdh-line" />
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <button id="sub" class="btn btn-raised btn-danger">提交</button>
                                            <a href="{:U('user/index')}" class="btn btn-raised btn-default">返回</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </section>
                    </div>
                </div>
            </div>
        </section>
        <!--/ CONTENT -->
    </div>
    <!--/ Application Content -->
    <!--Vendor JavaScripts  -->
    <include file="Public/footer" />
<!--/ Page Specific Scripts --> 
    
<script src="__PUBLIC__/assets/layer.js"></script>
    <script type="text/javascript">
    $("#sub").click(function () {

        var e = 0;
        var title = $("#title").val();
        var message = $("#message").val();
        var sta = document.getElementById("status").value;
        if (title == "") {
            layer.msg('请输入标题', function () {
                //关闭后的操作
                return false;
            });
            return false;
        }
        if (message == "") {
            layer.msg('请输入内容', function () {
                //关闭后的操作
                return false;
            });
            return false;
        }
        if (e == 0) {
            $.post("{:U('system/notice')}", { title: title, message:message,sta:sta}, function (data) {
                if (data.status == '1') {
                    layer.alert(data.info, { icon: 6 });//layer.msg('不开心。。', {icon: 5});
                    window.location.href = data.url;
                } else {
                    layer.alert(data.info, { icon: 5 });
                }
            })
        }

    })
</script>

</body>
</html>